clc;clear;close all;
Area = [1850,1850+500-1,1280,1280+500-1];
mask_filepath = "mask.bmp";
mask_fig = imread(mask_filepath);
mask_fig = mask_fig(Area(1):Area(2),Area(3):Area(4));
figure;imshow(mask_fig);
[fig_row, fig_col] = size(mask_fig);
MASK = zeros(fig_row,fig_col);
MASK(mask_fig > 10) = 1;
% J=im2bw(I);
se=strel('sphere',10);
MASK = imerode(MASK, se);
MASK(MASK == 0) = nan;
save("mask.mat","MASK");
